Current Location: Home> Function Categories> mt_srand

mt_srand

Sow a better random number generator seed
Name:mt_srand
Category:math
Programming Language:php
One-line Description:Seed Mersenne Twister Random Number Generator.

Definition and usage

mt_srand() seed Mersenne Twister Random Number Generator.

Example

In this example, we will seed the random number generator:

 <?php
mt_srand ( mktime ( ) ) ;
echo ( mt_rand ( ) ) ;
?>

Try it yourself

grammar

 mt_srand ( seed )
parameter describe
seed Required. Use seed to seed the random number generator.

illustrate

Starting from PHP version 4.2.0, the seed parameter becomes optional, and when this item is empty, it will be set to any time.

Similar Functions
  • Antihyperbolic cosine acosh

    acosh

    Antihyperboliccosine
  • Natural logarithm log

    log

    Naturallogarithm
  • Get the pi value pi

    pi

    Getthepivalue
  • Further method to sort ceil

    ceil

    Furthermethodtosort
  • Hyperbolic sine sinh

    sinh

    Hyperbolicsine
  • Leave the method of sorting floor

    floor

    Leavethemethodofsort
  • Returns exp(number) - 1, and can calculate the exact result even when the value of number is close to zero. expm1

    expm1

    Returnsexp(number)-1
  • Reverse cosine acos

    acos

    Reversecosine
Popular Articles